import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../share/size_fill.dart';

class ShowBottomAlertDialog {
  static Future showBottomDialog(
    BuildContext context, {
   required WidgetBuilder builder,
    double? height,
    double radius = 10.0,
  }) async {
    assert(builder != null);

    if (height == null) {
      height = SizeFill.screenHeight * 6 / 12;
    }
    final future = await showCupertinoModalPopup(
        context: context,
        builder: (context) {
          return Material(
            color: Colors.transparent,
            child: Container(
              height: height,
              width: double.infinity,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(radius),
                  topRight: Radius.circular(radius),
                ),
                color: Colors.white,
              ),
              child: builder(context),
            ),
          );
        });
    return future;
  }
}
